package com.rran.study.designpattern.behavioral.chain.enums;

import lombok.Getter;

@Getter
public enum HandleResult {

    FAIL(-1),
    STOP(0),
    CONTINUE(1),
    COMPLETE(99),
    ;
    private int value;

    HandleResult(int value) {
        this.value = value;
    }

    public static HandleResult parse(Integer value) {
        for (HandleResult handleResult : values()) {
            if (handleResult.getValue() == value) {
                return handleResult;
            }
        }
        return null;
    }
}
